package light.head.dao.inv;

import java.util.List;

import org.springframework.stereotype.Service;

import light.head.framework.base.BaseDAO;
import light.head.model.inv.InvOrderItem;
@Service
public class InvOrderItemDAO extends BaseDAO<InvOrderItem, Integer>{
	private final static String sql_findByIc = "FROM InvOrderItem ioi WHERE ioi.deleted = 0 AND ioi.oic = ?";
	private final static String sql_findBySnc = "FROM InvOrderItem ioi WHERE ioi.deleted = 0 AND (item.snc = 2 or item.snc = 3) AND ioi.oic = ?";
	/**
	 * 通过订单编号获取明细
	 * @param ic			订单编号
	 */
	public List<InvOrderItem> findByIc(Integer ic) {
		if (null == ic) return null;
		return find(sql_findByIc, null, null, ic);
	}
	
	public List<InvOrderItem> findBySnc(Integer ic){
		if (null == ic) return null;
		return find(sql_findBySnc, null, null, ic);
	}
 }
